package com.pengtu.gsj.dao.check.gcjs;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.pengtu.gsj.dao.hibernate.HibernateDao;
import com.pengtu.gsj.entity.gcjs.YHRoadConstructionA;

/**
 * 
 * 
 * YHRoadConstructionADao
 * 
 * 2017年5月26日 下午3:56:26
 * 
 * @version 1.0.0
 *
 */
@Repository
public class YHRoadConstructionADao extends HibernateDao<YHRoadConstructionA, String> {

	public List<YHRoadConstructionA> getRoadHardenConAYear(String startTime, String endTime) {
		String hql = "select new com.pengtu.gsj.entity.gcjs.YHRoadConstructionA(t.year) from YHRoadConstructionA t where t.delFlag='0' and t.year <="+endTime+"and t.year >="+startTime+" group by t.year order by t.year asc";
		return find(hql);
	}

	public List<YHRoadConstructionA> getCheckDataAByYear(String startTime, String endTime) {
		String hql= "select new com.pengtu.gsj.entity.gcjs.YHRoadConstructionA("
				+ " t.year,"
				+ " SUM(t.itemNum),"
				+ " SUM(t.workNum),"
				+ " SUM(t.completeNum),"
				+ " SUM(t.acceptNum))"
				+ " from YHRoadConstructionA t"
				+ " where t.delFlag = 0 and t.year >=  ? and t.year <= ? "
				+ " group by t.year";
		return find(hql, startTime, endTime);
	}
	
	
}
